<template>
	<view class="page">
		<view class="flex0">
			<u-navbar :fixed='false' bgColor="transparent" @leftClick="navBack"  title="学生心理健康服务平台">
				<view slot="center" class="navTitle">
					学生心理健康服务平台 
				</view>
			</u-navbar>
		</view>
		
		<view class="flex1">
			<scroll-view scroll-y="true" class="scrollView pt30">
				<div class="banner pd30" v-if="info.banner&&info.banner.length>0">
					<div class="banIn">
						<swiper :circular="true" :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" indicator-color="rgba(255,255,255,0.5)" indicator-active-color="#ff6e1f">
							<swiper-item v-for="ban in info.banner">
								<image :src="ban" mode="aspectFill"></image>
							</swiper-item>
						</swiper> 
					</div>
				</div>
				<view class="imgLinks pd30">
					<navigator url="" open-type="navigate" class="item">
						<image src="https://bjsx.gzwhir.com/admin-api/infra/file/18/get/link4.png" mode="widthFix"></image>
					</navigator>
					<navigator url="" open-type="navigate" class="item">
						<image src="https://bjsx.gzwhir.com/admin-api/infra/file/18/get/link5.png" mode="widthFix"></image>
					</navigator>
				</view>
				<view class="cepingList pd30" v-if="info.pendingWork">
					<view class="ceping">
						<view class="bg">
							<image src="https://bjsx.gzwhir.com/admin-api/infra/file/18/get/boxbg2.png" mode="aspectFill"></image>
						</view>
						<view class="tit">
							<view class="tl">
								<view class="t">
									{{info.pendingWork.title}}
								</view>
								<view class="p">
									{{info.pendingWork.endDate}}
								</view>
							</view>
							<view class="tr">
								待完成
							</view>
						</view>
						<view class="txt">
							<view class="xtit">
								<view class="xt">
									包含项目
								</view>
								<view class="num">
									<text class="cur">{{info.pendingWork.completed}}</text>
									<text>/</text>
									<text>{{info.pendingWork.total}}</text>
								</view>
							</view>
							<view class="xp">
								<u-line-progress height="10rpx" inactiveColor="#ffffff" activeColor="#fe9c29" :percentage="info.pendingWork.completed/info.pendingWork.total*100" :showText="false"></u-line-progress>
							</view>
						</view>
					</view>
				</view>
				<view class="taskBlock pd30" v-if="info.taskList&&info.taskList.length>0">
					<view class="box">
						<view class="tit">
							<image src="@/static/images/title4.png" mode="heightFix"></image>
						</view>
						<view class="taskList">
							<view class="item" v-for="task in info.taskList">
								<view class="date">
									{{task.date}}
								</view>
								<view class="ul">
									<view class="li" v-for="(i,index) in task.list">
										<view class="or">
											{{'任务'+orderNums[index]}}
										</view>
										<view class="lt">
											{{i.title}}
										</view>
										<view class="btn">
											去完成
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="floor pd30" v-if="info.knowledge&&info.knowledge.length>0">
					<view class="floorTit">
						<view class="tit">
							<image src="@/static/images/title1.png" mode="heightFix"></image>
						</view>
						<navigator url="" open-type="navigate" class="more">
							<text>更多</text>
							<view class="ico">
								<image src="@/static/images/icon-more.png" mode="aspectFit"></image>
							</view>
						</navigator>
					</view>
					<view class="floorCon">
						<scroll-view scroll-x="true" class="xScroller">
							<view class="xScrollFlex">
								<navigator url="" open-type="navigate" class="knowledgeCard" v-for="i in info.knowledge">
									<view class="bg">
										<image src="@/static/images/boxbg1.png" mode="aspectFit"></image>
									</view>
									<view class="ico">
										<image src="@/static/images/icon-quato.png" mode="aspectFit"></image>
									</view>
									<view class="txt">
										<view class="it">
											{{i.title}}
										</view>
										<view class="ip">
											{{i.info}}
										</view>
									</view>
								</navigator>
							</view>
						</scroll-view>
					</view>
				</view>
				<view class="floor pd30 white" v-if="info.story&&info.story.length>0">
					<view class="floorTit">
						<view class="tit">
							<image src="@/static/images/title2.png" mode="heightFix"></image>
						</view>
						<navigator url="" open-type="navigate" class="more">
							<text>更多</text>
							<view class="ico">
								<image src="@/static/images/icon-more.png" mode="aspectFit"></image>
							</view>
						</navigator>
					</view>
					<view class="floorCon">
						<scroll-view scroll-x="true" class="xScroller">
							<view class="xScrollFlex">
								<navigator url="" open-type="navigate" class="storyCard" v-for="i in info.story">
									<view class="img">
										<image :src="i.image" mode="widthFix"></image>
									</view>
									<view class="txt">
										<view class="it">
											{{i.title}}
										</view>
									</view>
								</navigator>
							</view>
						</scroll-view>
					</view>
				</view>
				<view class="floor pd30" v-if="info.article&&info.article.length>0">
					<view class="floorTit">
						<view class="tit">
							<image src="@/static/images/title3.png" mode="heightFix"></image>
						</view>
						<navigator url="" open-type="navigate" class="more">
							<text>更多</text>
							<view class="ico">
								<image src="@/static/images/icon-more.png" mode="aspectFit"></image>
							</view>
						</navigator>
					</view>
					<view class="floorCon">
						<scroll-view scroll-x="true" class="xScroller">
							<view class="xScrollFlex">
								<navigator url="" open-type="navigate" class="normalCard" v-for="i in info.article">
									<view class="img">
										<image :src="i.image" mode="widthFix"></image>
									</view>
									<view class="txt">
										<view class="it">
											{{i.title}}
										</view>
										<view class="date">
											{{i.date}}
										</view>
									</view>
								</navigator>
							</view>
						</scroll-view>
					</view>
				</view>
			</scroll-view>
		</view>
		<view class="flex0">
			<TabBar :active="0" type="expert"></TabBar>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderNums:['一','二','三','四','五','六','七','八','九','十'],
				info:{}
			}
		},
		methods: {
			getInfo(){
				var that=this;
				var res={
					banner:['../../../static/upload/banner.png','../../../static/upload/banner.png','../../../static/upload/banner.png'],
					taskList:[
						{
							date:'2024.09.25 12:30',
							list:[
								{
									id:101,
									title:'心理辅导'
								},
								{
									id:101,
									title:'心理健康教育课程/视频'
								}
							]
						},
						{
							date:'2024.09.26 14:00',
							list:[
								{
									id:101,
									title:'日常观察 '
								}
							]
						}
					],
					knowledge:[
						{
							id:101,
							title:'如何守护孩子心理健康?',
							info:'家长需要知道这6方面'
						},
						{
							id:101,
							title:'面对孩子拖延接纳是改变的开始',
							info:'建议采用小步走，微习惯'
						},
						{
							id:101,
							title:'如何守护孩子心理健康?',
							info:'家长需要知道这6方面'
						},
						{
							id:101,
							title:'面对孩子拖延接纳是改变的开始',
							info:'建议采用小步走，微习惯'
						},
						{
							id:101,
							title:'如何守护孩子心理健康?',
							info:'家长需要知道这6方面'
						},
						{
							id:101,
							title:'面对孩子拖延接纳是改变的开始',
							info:'建议采用小步走，微习惯'
						}
					],
					story:[
						{
							id:101,
							title:'父亲节即至，听听CUMTers久藏的心里话',
							image:'../../../static/upload/index11.jpg'
						},
						{
							id:101,
							title:'青听青语|这个宿舍我是一点也待不下去了!',
							image:'../../../static/upload/index12.jpg'
						},
						{
							id:101,
							title:'父亲节即至，听听CUMTers久藏的心里话',
							image:'../../../static/upload/index11.jpg'
						},
						{
							id:101,
							title:'青听青语|这个宿舍我是一点也待不下去了!',
							image:'../../../static/upload/index12.jpg'
						}
					],
					article:[
						{
							id:101,
							title:'谨防“开学综合征”!家长应关注这些求助信号',
							image:'../../../static/upload/index21.jpg',
							date:'2024.09.10'
						},
						{
							id:101,
							title:'面对孩子拖延，接纳是改变的开始',
							image:'../../../static/upload/index22.jpg',
							date:'2024.09.10'
						},
						{
							id:101,
							title:'谨防“开学综合征”!家长应关注这些求助信号',
							image:'../../../static/upload/index21.jpg',
							date:'2024.09.10'
						},
						{
							id:101,
							title:'面对孩子拖延，接纳是改变的开始',
							image:'../../../static/upload/index22.jpg',
							date:'2024.09.10'
						},
					]
				};
				that.info=res;
			}
		},
		mounted(){
			this.getInfo();
		}
	}
</script>

<style lang="scss" scoped>
	.banner{
		margin-bottom: 10rpx;
		.banIn{
			padding-bottom: 46.38%;
			position: relative;
			swiper{
				width: 100%;
				height: 100%;
				border-radius: 30rpx;
				overflow: hidden;
				position: absolute;
				left: 0;
				top: 0;
				image{
					display: block;
					width: 100%;
					height: 100%;
				}
			}
		}
	}
	.imgLinks{
		padding-top: 20rpx;
		display: flex;
		align-items: stretch;
		justify-content: space-between;
		margin-bottom: 20rpx;
		.item{
			border: none !important;
			opacity: 1 !important;
			outline: none !important;
			background: none !important;
			flex: 0 0 auto;
			width: 50%;
			display: flex;
			align-items: flex-end;
			justify-content: flex-start;
			image{
				display: block;
				width: 103%;
				height: auto;
				flex: 0 0 auto;
			}
			&:nth-child(2){
				justify-content: flex-end;
			}
		}
	}
	.normalCard{
		flex: 0 0 auto;
		position: relative;
		width: 320rpx;
		z-index: 5;
		margin-right: 25rpx;
		border: none !important;
		opacity: 1 !important;
		outline: none !important;
		background: #fff !important;
		border-radius: 20rpx;
		overflow: hidden;
		white-space: normal;
		display: flex;
		flex-direction: column;
		&:before,&:after{
			display: none;
		}
		&:last-child{
			margin-right: 0;
		}
		.img{
			flex: 0 0 auto;
			width: 100%;
			image{
				display: block;
				width: 100%;
				height: auto;
			}
		}
		.txt{
			padding: 25rpx;
			flex:1 1 auto;
			box-sizing: border-box;
			width: 100%;
			display: flex;
			flex-direction: column;
			.it{
				margin-bottom: 30rpx;
				font-size: 28rpx;
				line-height: 40rpx;
				max-height: 120rpx;
				overflow: hidden;
				color: #7a6458;
				flex: 1 1 auto;
				width: 100%;
			}
			.date{
				width: 100%;
				font-size: 22rpx;
				color: #897f7a;
				flex: 0 0 auto;
			}
		}
	}
	.storyCard{
		flex: 0 0 auto;
		position: relative;
		width: 320rpx;
		z-index: 5;
		margin-right: 25rpx;
		border: none !important;
		opacity: 1 !important;
		outline: none !important;
		background: none !important;
		border-radius: 20rpx;
		overflow: hidden;
		white-space: normal;
		&:before,&:after{
			display: none;
		}
		&:last-child{
			margin-right: 0;
		}
		.img{
			image{
				display: block;
				width: 100%;
				height: auto;
			}
		}
		.txt{
			position: absolute;
			left: 0;
			bottom: 0;
			width: 100%;
			padding: 0 25rpx 30rpx;
			box-sizing: border-box;
			z-index: 10;
			.it{
				font-size: 32rpx;
				line-height: 40rpx;
				color: #fff;
				max-height: 160rpx;
				overflow: hidden;
			}
		}
	}
	.knowledgeCard{
		flex: 0 0 auto;
		position: relative;
		width: 320rpx;
		height: 330rpx;
		z-index: 5;
		margin-right: 25rpx;
		border: none !important;
		opacity: 1 !important;
		outline: none !important;
		background: none !important;
		&:before,&:after{
			display: none;
		}
		&:last-child{
			margin-right: 0;
		}
		.bg{
			position: absolute;
			left: 0;
			top: 0;
			width: 100%;
			height: 100%;
			z-index: -1;
			image{
				display: block;
				width: 100%;
				height: 100%;
			}
		}
		.ico{
			position: absolute;
			right: 30rpx;
			top: 20rpx;
			image{
				display: block;
				width: 85rpx;
				height: 60rpx;
			}
		}
		.txt{
			position: absolute;
			top: 125rpx;
			left: 0;
			width: 100%;
			bottom: 0;
			z-index: 5;
			padding: 0 25rpx 30rpx;
			box-sizing: border-box;
			white-space: normal;
			.it{
				font-size: 32rpx;
				line-height: 40rpx;
				max-height: 80rpx;
				overflow: hidden;
				color: #7a6458;
				margin-bottom: 20rpx;
			}
			.ip{
				font-size: 20rpx;
				line-height: 36rpx;
				max-height: 72rpx;
				overflow: hidden;
				color: #897f7a;
			}
		}
	}
</style>
